//
//  NSDictionary+hf.m
//  ThridPackage
//
//  Created by 韩艳锋 on 2019/7/26.
//  Copyright © 2019 韩艳锋. All rights reserved.
//

#import "NSDictionary+hf.h"
#import "NSArray+hf.h"

@implementation NSDictionary (hf)

- (NSMutableDictionary*)fliterNSNull {
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    NSArray * allKey = self.allKeys;
    for (id item in allKey) {
        id value = self[item];
        if (value == nil || [value isKindOfClass: [NSNull class]]) {
            continue;
        } else if ([value isKindOfClass: [NSDictionary class]]) {
            [dic setObject:[value fliterNSNull] forKey:item];
        } else if ([value isKindOfClass: [NSArray class]]) {
            [dic setObject:[value fliterNSNull] forKey:item];
        } else {
            [dic setObject:value forKey:item];
        }
    }
    return dic;
}
@end
